class UserMailer < ActionMailer::Base
  def signup_notification(user)
    setup_email(user)
    @subject    += '--请激活您的账户'

    @body[:url]  = "http://www.bjkt114.com/activate/#{user.activation_code}"

  end

  def activation(user)
    setup_email(user)
    @subject    += '您的账户已经激活，您可以登录进行使用了'
    @body[:url]  = "http://www.bjkt114.com/"
  end

  protected
  def setup_email(user)
    @recipients  = "#{user.email}"
    @from        = "koop_liu@foxmail.com"
    @subject     = "北京空调团购集采网"
    @sent_on     = Time.now
    @body[:user] = user
  end
end

